package com.nut.lmsc.api.admin;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.nut.lmsc.api.req.OrderQueryReq;
import com.nut.lmsc.common.Result;
import com.nut.lmsc.entity.Order;
import com.nut.lmsc.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RestController
@RequestMapping("/admin/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping(value = "list")
    public Result<IPage<Order>> list(OrderQueryReq req) {
        return orderService.listPage(req);
    }

    @GetMapping(value = "/{orderId}")
    public Result<Order> detail(@PathVariable String orderId) {
        return orderService.detail(orderId);
    }

}